/**
  ******************************************************************************
  * @file    bsp_ble.h
  * @author  Iron
  * @date    2018-07-19
  * @version v1.0
  * @brief   bsp ble header file
  */

#ifndef __BSP_BLE_H
#define __BSP_BLE_H

#ifdef __cplusplus
extern "C" {
#endif

/* includes ------------------------------------------------------------------*/
#include <stdint.h>

/* exported types ------------------------------------------------------------*/
/* exported constants --------------------------------------------------------*/
/* exported macro ------------------------------------------------------------*/
/* exported functions ------------------------------------------------------- */
int32_t ble_is_link(void);
int bsp_ble_init(void);

int32_t ble_uart_send(uint8_t *data, int32_t len, uint32_t timeout);
int32_t ble_uart_getbyte(uint8_t *data, uint32_t timeout);
int32_t ble_uart_recv(uint8_t *data, int32_t size, uint32_t timeout);

// The function caller take the responsibility to keep "data" safe!
int32_t ble_uart_send_no_wait(uint8_t *data, int32_t len);

/**
  * @}
  */

#ifdef __cplusplus
}
#endif

#endif /* __BSP_BLE_H */

/******************* (C)COPYRIGHT 2018 ***** END OF FILE *********************/
